agora inbox for [email protected]
help / color / mirror / Atom feedabout explain analyze
975+ messages / 4 participants
[nested] [flat]
* about explain analyze
@ 2003-11-27 14:13 Teodor Sigaev <[email protected]>
2003-11-28 16:48 ` Re: about explain analyze Tom Lane <[email protected]>
0 siblings, 1 reply; 975+ messages in thread
From: Teodor Sigaev @ 2003-11-27 14:13 UTC (permalink / raw)
To: pgsql-hackers
Hello!
Explain analyze takes 3 times more time for execution. Why?
wow=# \timing
Timing is on.
wow=# select max(click.accesses) from click;
max
----------
10944762
(1 row)
Time: 105,654 ms
wow=# explain analyze select max(click.accesses) from click;
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------
Aggregate (cost=1103.70..1103.70 rows=1 width=8) (actual
time=289.391..289.393 rows=1 loops=1)
-> Seq Scan on click (cost=0.00..971.36 rows=52936 width=8) (actual
time=0.013..133.943 rows=52936 loops=1)
Total runtime: 289.498 ms
(3 rows)
Time: 290,695 ms
wow=# select version();
version
---------------------------------------------------------------------------------------------------------
PostgreSQL 7.4 on i386-unknown-freebsd5.1, compiled by GCC gcc (GCC) 3.2.2
[FreeBSD] 20030205 (release)
(1 row)
--
Teodor Sigaev E-mail: [email protected]
^ permalink raw reply [nested|flat] 975+ messages in thread
* Re: about explain analyze
2003-11-27 14:13 about explain analyze Teodor Sigaev <[email protected]>
@ 2003-11-28 16:48 ` Tom Lane <[email protected]>
2003-11-28 17:00 ` Re: about explain analyze Marc G. Fournier <[email protected]>
2003-11-28 18:05 ` Re: about explain analyze Teodor Sigaev <[email protected]>
0 siblings, 2 replies; 975+ messages in thread
From: Tom Lane @ 2003-11-28 16:48 UTC (permalink / raw)
To: Teodor Sigaev <[email protected]>; +Cc: pgsql-hackers
Teodor Sigaev <[email protected]> writes:
> Explain analyze takes 3 times more time for execution. Why?
Measurement overhead. It would seem your platform has a particularly
slow version of gettimeofday() though ... I've never noticed such a
large discrepancy myself.
regards, tom lane
^ permalink raw reply [nested|flat] 975+ messages in thread
* Re: about explain analyze
2003-11-27 14:13 about explain analyze Teodor Sigaev <[email protected]>
2003-11-28 16:48 ` Re: about explain analyze Tom Lane <[email protected]>
@ 2003-11-28 17:00 ` Marc G. Fournier <[email protected]>
2003-11-28 17:13 ` Re: about explain analyze Tom Lane <[email protected]>
1 sibling, 1 reply; 975+ messages in thread
From: Marc G. Fournier @ 2003-11-28 17:00 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: Teodor Sigaev <[email protected]>; pgsql-hackers
On Fri, 28 Nov 2003, Tom Lane wrote:
> Teodor Sigaev <[email protected]> writes:
> > Explain analyze takes 3 times more time for execution. Why?
>
> Measurement overhead. It would seem your platform has a particularly
> slow version of gettimeofday() though ... I've never noticed such a
> large discrepancy myself.
Actually, I'm noticing similar "problems" with v7.4 ... "EXPLAIN ANALYZE"
seems to be showing some *very* high ms for execution time, but if you run
the actual query, it doesn't seem to take even 1/10th the time reported
...
This is on a FreeBSD 4.x box ...
----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: [email protected] Yahoo!: yscrappy ICQ: 7615664
^ permalink raw reply [nested|flat] 975+ messages in thread
* Re: about explain analyze
2003-11-27 14:13 about explain analyze Teodor Sigaev <[email protected]>
2003-11-28 16:48 ` Re: about explain analyze Tom Lane <[email protected]>
2003-11-28 17:00 ` Re: about explain analyze Marc G. Fournier <[email protected]>
@ 2003-11-28 17:13 ` Tom Lane <[email protected]>
2003-11-28 17:59 ` Re: about explain analyze Marc G. Fournier <[email protected]>
0 siblings, 1 reply; 975+ messages in thread
From: Tom Lane @ 2003-11-28 17:13 UTC (permalink / raw)
To: Marc G. Fournier <[email protected]>; +Cc: Teodor Sigaev <[email protected]>; pgsql-hackers
"Marc G. Fournier" <[email protected]> writes:
> Actually, I'm noticing similar "problems" with v7.4 ... "EXPLAIN ANALYZE"
> seems to be showing some *very* high ms for execution time, but if you run
> the actual query, it doesn't seem to take even 1/10th the time reported
> ...
Example? I don't see anything out of line here.
regards, tom lane
^ permalink raw reply [nested|flat] 975+ messages in thread
* Re: about explain analyze
2003-11-27 14:13 about explain analyze Teodor Sigaev <[email protected]>
2003-11-28 16:48 ` Re: about explain analyze Tom Lane <[email protected]>
2003-11-28 17:00 ` Re: about explain analyze Marc G. Fournier <[email protected]>
2003-11-28 17:13 ` Re: about explain analyze Tom Lane <[email protected]>
@ 2003-11-28 17:59 ` Marc G. Fournier <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Marc G. Fournier @ 2003-11-28 17:59 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: Marc G. Fournier <[email protected]>; Teodor Sigaev <[email protected]>; pgsql-hackers
On Fri, 28 Nov 2003, Tom Lane wrote:
> "Marc G. Fournier" <[email protected]> writes:
> > Actually, I'm noticing similar "problems" with v7.4 ... "EXPLAIN ANALYZE"
> > seems to be showing some *very* high ms for execution time, but if you run
> > the actual query, it doesn't seem to take even 1/10th the time reported
> > ...
>
> Example? I don't see anything out of line here.
pgsql74# /usr/local/pgsql/bin/psql -U pgsql -c "SELECT count(rec_id) FROM url" 186_archives
count
--------
209872
(1 row)
pgsql74# /usr/local/pgsql/bin/psql -U pgsql -c "EXPLAIN ANALYZE SELECT max(rec_id) FROM url" 186_archives
QUERY PLAN
--------------------------------------------------------------------------------------------------------------------
Aggregate (cost=11177.19..11177.19 rows=1 width=4) (actual time=2400.579..2400.585 rows=1 loops=1)
-> Seq Scan on url (cost=0.00..10741.55 rows=174255 width=4) (actual time=0.056..1387.803 rows=209872 loops=1)
Total runtime: 2407.095 ms
(3 rows)
pgsql74# time /usr/local/pgsql/bin/psql -U pgsql -c "SELECT max(rec_id) FROM url" 186_archives
max
--------
690582
(1 row)
0.000u 0.004s 0:00.32 0.0% 0+0k 0+0io 0pf+0w
----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: [email protected] Yahoo!: yscrappy ICQ: 7615664
^ permalink raw reply [nested|flat] 975+ messages in thread
* Re: about explain analyze
2003-11-27 14:13 about explain analyze Teodor Sigaev <[email protected]>
2003-11-28 16:48 ` Re: about explain analyze Tom Lane <[email protected]>
@ 2003-11-28 18:05 ` Teodor Sigaev <[email protected]>
2003-11-28 18:29 ` Re: about explain analyze Tom Lane <[email protected]>
1 sibling, 1 reply; 975+ messages in thread
From: Teodor Sigaev @ 2003-11-28 18:05 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: pgsql-hackers
How many times is gettimeofday called?
wow=# explain analyze select 1;
QUERY PLAN
------------------------------------------------------------------------------------
Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.008..0.010 rows=1 loops=1)
Total runtime: 0.047 ms
(2 rows)
Several thousands?
Tom Lane wrote:
> Teodor Sigaev <[email protected]> writes:
>
>>Explain analyze takes 3 times more time for execution. Why?
>
>
> Measurement overhead. It would seem your platform has a particularly
> slow version of gettimeofday() though ... I've never noticed such a
> large discrepancy myself.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
--
Teodor Sigaev E-mail: [email protected]
^ permalink raw reply [nested|flat] 975+ messages in thread
* Re: about explain analyze
2003-11-27 14:13 about explain analyze Teodor Sigaev <[email protected]>
2003-11-28 16:48 ` Re: about explain analyze Tom Lane <[email protected]>
2003-11-28 18:05 ` Re: about explain analyze Teodor Sigaev <[email protected]>
@ 2003-11-28 18:29 ` Tom Lane <[email protected]>
2003-11-28 20:07 ` Re: about explain analyze Teodor Sigaev <[email protected]>
0 siblings, 1 reply; 975+ messages in thread
From: Tom Lane @ 2003-11-28 18:29 UTC (permalink / raw)
To: Teodor Sigaev <[email protected]>; +Cc: pgsql-hackers
Teodor Sigaev <[email protected]> writes:
> How many times is gettimeofday called?
Twice per plan node visit, if you are doing EXPLAIN ANALYZE. (The
number of "visits" is one more than the number of rows returned.)
regards, tom lane
^ permalink raw reply [nested|flat] 975+ messages in thread
* Re: about explain analyze
2003-11-27 14:13 about explain analyze Teodor Sigaev <[email protected]>
2003-11-28 16:48 ` Re: about explain analyze Tom Lane <[email protected]>
2003-11-28 18:05 ` Re: about explain analyze Teodor Sigaev <[email protected]>
2003-11-28 18:29 ` Re: about explain analyze Tom Lane <[email protected]>
@ 2003-11-28 20:07 ` Teodor Sigaev <[email protected]>
2003-11-28 20:14 ` Re: about explain analyze Tom Lane <[email protected]>
0 siblings, 1 reply; 975+ messages in thread
From: Teodor Sigaev @ 2003-11-28 20:07 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: pgsql-hackers
Tom, I am afraid that I don't understand. My first example:
wow=# explain analyze select max(click.accesses) from click;
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------
Aggregate (cost=1103.70..1103.70 rows=1 width=8) (actual
time=289.391..289.393 rows=1 loops=1)
-> Seq Scan on click (cost=0.00..971.36 rows=52936 width=8) (actual
time=0.013..133.943 rows=52936 loops=1)
Total runtime: 289.498 ms
(3 rows)
Time: 290,695 ms
select max() returns only one row... If you mean rows in Seq Scan than
gettimeofday was called (52936+1)*2. Huge value :(
Tom Lane wrote:
> Teodor Sigaev <[email protected]> writes:
>
>>How many times is gettimeofday called?
>
>
> Twice per plan node visit, if you are doing EXPLAIN ANALYZE. (The
> number of "visits" is one more than the number of rows returned.)
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
--
Teodor Sigaev E-mail: [email protected]
^ permalink raw reply [nested|flat] 975+ messages in thread
* Re: about explain analyze
2003-11-27 14:13 about explain analyze Teodor Sigaev <[email protected]>
2003-11-28 16:48 ` Re: about explain analyze Tom Lane <[email protected]>
2003-11-28 18:05 ` Re: about explain analyze Teodor Sigaev <[email protected]>
2003-11-28 18:29 ` Re: about explain analyze Tom Lane <[email protected]>
2003-11-28 20:07 ` Re: about explain analyze Teodor Sigaev <[email protected]>
@ 2003-11-28 20:14 ` Tom Lane <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Tom Lane @ 2003-11-28 20:14 UTC (permalink / raw)
To: Teodor Sigaev <[email protected]>; +Cc: pgsql-hackers
Teodor Sigaev <[email protected]> writes:
> Tom, I am afraid that I don't understand. My first example:
> wow=# explain analyze select max(click.accesses) from click;
> QUERY PLAN
> -----------------------------------------------------------------------------------------------------------------
> Aggregate (cost=1103.70..1103.70 rows=1 width=8) (actual
> time=289.391..289.393 rows=1 loops=1)
> -> Seq Scan on click (cost=0.00..971.36 rows=52936 width=8) (actual
> time=0.013..133.943 rows=52936 loops=1)
> Total runtime: 289.498 ms
> (3 rows)
> Time: 290,695 ms
> select max() returns only one row... If you mean rows in Seq Scan than
> gettimeofday was called (52936+1)*2. Huge value :(
Right, that many times at the Seq Scan plan node, and (1+1)*2 more times
at the Aggregate node.
regards, tom lane
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
* [PATCH 3/9] remove excess parens around ereport
@ 2026-03-12 15:09 Álvaro Herrera <[email protected]>
0 siblings, 0 replies; 975+ messages in thread
From: Álvaro Herrera @ 2026-03-12 15:09 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 78 ++++++++++++++++++----------------
1 file changed, 41 insertions(+), 37 deletions(-)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index db3980b84f5..af47354e382 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -992,10 +992,10 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
/* Data changes in system relations are not logically decoded. */
if (IsCatalogRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for catalog relations.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for catalog relations."));
/*
* reorderbuffer.c does not seem to handle processing of TOAST relation
@@ -1003,28 +1003,28 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
*/
if (IsToastRelation(rel))
ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too.")));
+ errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is not supported for TOAST relations, unless the main relation is repacked too."));
relpersistence = rel->rd_rel->relpersistence;
if (relpersistence != RELPERSISTENCE_PERMANENT)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("REPACK CONCURRENTLY is only allowed for permanent relations.")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("REPACK CONCURRENTLY is only allowed for permanent relations."));
/* With NOTHING, WAL does not contain the old tuple. */
replident = rel->rd_rel->relreplident;
if (replident == REPLICA_IDENTITY_NOTHING)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot repack relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has insufficient replication identity.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot repack relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has insufficient replication identity.",
+ RelationGetRelationName(rel)));
/*
* If the identity index is not set due to replica identity being, PK
@@ -1035,11 +1035,11 @@ check_repack_concurrently_requirements(Relation rel, Oid *ident_idx_p)
ident_idx = rel->rd_pkindex;
if (!OidIsValid(ident_idx))
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("cannot process relation \"%s\"",
- RelationGetRelationName(rel)),
- errhint("Relation \"%s\" has no identity index.",
- RelationGetRelationName(rel))));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot process relation \"%s\"",
+ RelationGetRelationName(rel)),
+ errhint("Relation \"%s\" has no identity index.",
+ RelationGetRelationName(rel)));
*ident_idx_p = ident_idx;
}
@@ -2793,20 +2793,21 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
ReadLocalXLogPageNoWaitPrivate *priv;
if (errm)
- ereport(ERROR, (errmsg("%s", errm)));
+ ereport(ERROR,
+ errmsg("%s", errm));
/*
* In the decoding loop we do not want to get blocked when there
* is no more WAL available, otherwise the loop would become
* uninterruptible.
*/
- priv = (ReadLocalXLogPageNoWaitPrivate *)
- ctx->reader->private_data;
+ priv = (ReadLocalXLogPageNoWaitPrivate *) ctx->reader->private_data;
if (priv->end_of_wal)
/* Do not miss the end of WAL condition next time. */
priv->end_of_wal = false;
else
- ereport(ERROR, (errmsg("could not read WAL record")));
+ ereport(ERROR,
+ errmsg("could not read WAL record"));
}
/*
@@ -2852,7 +2853,8 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
timeout);
if (res != WAIT_LSN_RESULT_SUCCESS &&
res != WAIT_LSN_RESULT_TIMEOUT)
- ereport(ERROR, (errmsg("waiting for WAL failed")));
+ ereport(ERROR,
+ errmsg("waiting for WAL failed"));
}
}
@@ -3050,7 +3052,8 @@ apply_concurrent_update(Relation rel, HeapTuple tup, HeapTuple tup_target,
&tmfd, &lockmode, &update_indexes,
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent UPDATE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent UPDATE"));
ExecStoreHeapTuple(tup, index_slot, false);
@@ -3091,7 +3094,8 @@ apply_concurrent_delete(Relation rel, HeapTuple tup_target)
false /* wal_logical */ );
if (res != TM_Ok)
- ereport(ERROR, (errmsg("failed to apply concurrent DELETE")));
+ ereport(ERROR,
+ errmsg("failed to apply concurrent DELETE"));
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
}
@@ -3576,7 +3580,7 @@ rebuild_relation_finish_concurrent(Relation NewHeap, Relation OldHeap,
* Should not happen, given our lock on the old relation.
*/
ereport(ERROR,
- (errmsg("identity index missing on the new relation")));
+ errmsg("identity index missing on the new relation"));
/* Gather information to apply concurrent changes. */
chgdst.rel = NewHeap;
@@ -3864,9 +3868,9 @@ start_decoding_worker(Oid relid)
decoding_worker = palloc0_object(DecodingWorker);
if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
ereport(ERROR,
- (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
- errmsg("out of background worker slots"),
- errhint("You might need to increase \"%s\".", "max_worker_processes")));
+ errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
+ errmsg("out of background worker slots"),
+ errhint("You might need to increase \"%s\".", "max_worker_processes"));
decoding_worker->seg = seg;
decoding_worker->error_mqh = mqh;
@@ -3921,8 +3925,8 @@ stop_decoding_worker(void)
if (status == BGWH_POSTMASTER_DIED)
ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("postmaster exited during REPACK command")));
+ errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("postmaster exited during REPACK command"));
shm_mq_detach(decoding_worker->error_mqh);
@@ -3979,8 +3983,8 @@ RepackWorkerMain(Datum main_arg)
seg = dsm_attach(DatumGetUInt32(main_arg));
if (seg == NULL)
ereport(ERROR,
- (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("could not map dynamic shared memory segment")));
+ errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("could not map dynamic shared memory segment"));
shared = (DecodingWorkerShared *) dsm_segment_address(seg);
--
2.47.3
--pnppmxqkefjd4hu2
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename="0004-XLogRecPtrIsInvalid-XLogRecPtrIsValid.nocfbot.txt"
^ permalink raw reply [nested|flat] 975+ messages in thread
end of thread, other threads:[~2026-03-12 15:09 UTC | newest]
Thread overview: 975+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-11-27 14:13 about explain analyze Teodor Sigaev <[email protected]>
2003-11-28 16:48 ` Tom Lane <[email protected]>
2003-11-28 17:00 ` Marc G. Fournier <[email protected]>
2003-11-28 17:13 ` Tom Lane <[email protected]>
2003-11-28 17:59 ` Marc G. Fournier <[email protected]>
2003-11-28 18:05 ` Teodor Sigaev <[email protected]>
2003-11-28 18:29 ` Tom Lane <[email protected]>
2003-11-28 20:07 ` Teodor Sigaev <[email protected]>
2003-11-28 20:14 ` Tom Lane <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Álvaro Herrera <[email protected]>
2026-03-12 15:09 [PATCH 3/9] remove excess parens around ereport Á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